/*
 * @Author: DUST
 * @Date: 2023-05-28 15:13:35
 * @LastEditors: DUST
 * @LastEditTime: 2023-11-27 14:13:15
 * @FilePath: \business-card-system\server\app\service\AccountService.ts
 * @Description: 
 * undefined
 */

import Account from "../model/Account";

class AccountService {
  /**
   * @description: 根据用户名获取账号信息
   * @param {string} username:用户名
   */  
  getAccountByUsername(username: string) {
    return Account.findOne({
      where: {
        username: username
      }
    })
  }
  /**
   * @description: 根据id查询账号信息
   * @param {number} id：需要查询的id
   */  
  getUserInfoById(id: number) {
    return Account.findByPk(id);
  }
  /**
   * @description: 新增账号信息
   * @param {number} values: 字段内容
   */  
  editUserPwd(values: any, id: number) {
    return Account.update(values, {
      where: { id },
    });
  }
} 

export default new AccountService;